# from django import forms
# 
# class BirdAddToCartForm(forms.Form):
#     quantity = forms.IntegerField(widget=forms.TextInput(attrs={'size':'2',
#                 'value':'1', 'class':'quantity', 'maxlength':'5'}),
#                 error_message={'invalid':'Por favor introduzca una cantidad válida.'},
#                 min_value=1)
#     bird_slug = forms.CharField(widget=forms.HiddenInput())
#     
#     # override the default __init__ so we can set the request
#     def __init__(self, request=None, *args, **kwargs):
#         self.request = request
#         super(BirdAddToCartForm, self).__init__(*args, **kwargs)
#         
#     # custom validation to check for cookies
#     def clean(self):
#         if self.request:
#             if not self.request.session.test_cookie_worked():
#                 raise forms.ValidationError("Las Cookies deben estar habilitadas.")
#             return self.cleaned_data